// log.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"

#include "./filelog/filelog.h"

LIBVERSION __log_libversion = log_libversion;


static bool CheckVersion(LIBVERSION libversion)
{
    if (__log_libversion == libversion)
    {
        return true;
    }

    return false;
}

IFileLog* CreateFileLog(const char* pszDir, const char* pszFileName /* = "" */, LIBVERSION libversion /* = log_libversion */)
{
    if (!CheckVersion(libversion))
    {
        return NULL;
    }

    CFileLog* log = new CFileLog;
    if (log)
    {
        if (log->Init(pszDir, pszFileName))
        {
            return log;
        }

        log->Release();
        log = NULL;
    }

    return log;
}